package com.hdaccp.shuiguoD.controller;


import com.hdaccp.shuiguoD.entity.Jinhuols;
import com.hdaccp.shuiguoD.entity.Xiaoshouls;
import com.hdaccp.shuiguoD.service.jinxiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Controller
@RequestMapping("/jinxiao")
@Scope("prototype")
public class jinxiaoController {


    @Autowired
    private jinxiaoService jinxiaoService;






    @RequestMapping("/jinhuo")
    @ResponseBody
    public List<Jinhuols> jinxiao(String yi, String er){

        return jinxiaoService.jinhuo(yi,er);
    }

    @RequestMapping("/xiaoshou")
    @ResponseBody
    public List<Xiaoshouls> xiaoshou(String yi, String er){


        return jinxiaoService.xiaoshou(yi,er) ;
    }


    /**
     * 导出所有进货信息
     * @param response
     */
    @RequestMapping("/export.action")
    public void ExportExcel(HttpServletResponse response){
        jinxiaoService.ExportUserList(response);
    }

    /**
     * 导出所有销售信息
     * @param response
     */
    @RequestMapping("/export.actiom")
    public void ExportExcel1(HttpServletResponse response){
        jinxiaoService.ExportUserList1(response);
    }

}
